//
//  BananerCollectionViewCell.m
//  Findif
//
//  Created by Cicel Chen on 2018/10/18.
//  Copyright © 2018年 Cicel Chen. All rights reserved.
//

#import "BananerCollectionViewCell.h"

@interface BananerCollectionViewCell ()

@property (nonatomic, weak)UIImageView * imageView;


@end

@implementation BananerCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        //设置控件
        [self setupUI];
    }
    
    return self;
}

- (void)setModel:(BannerModel *)model{
    
    _model = model;
    
    NSString * usrlStr = [NSString stringWithFormat:@"%@%@",BASEURLSTR,model.img];
    
    NSURL * url = [NSURL URLWithString:usrlStr];
    
    [self.imageView sd_setImageWithURL:url];
}

- (void)setupUI{
    
    UIImageView * imageView = [[UIImageView alloc] initWithFrame:self.bounds];
    
    imageView.backgroundColor = [UIColor lightGrayColor];
    
    self.imageView = imageView;
    
    [self.contentView addSubview:self.imageView];
    
    
}

@end
